package com.topsec.tss.hdfs.api;

import java.util.Map;


/**
 * 
 * 
 * 
 * 事件相关接口
 * 
 * @title EventServerAPI
 * @package com.topsec.tss.hdfs.rest
 * @author ypf
 * @version
 * @date 2014-9-4
 * 
 */
public interface RedisApi {

    /**
     * Redis 访问路径.
     */
    final public static String REST_HOME = "/res";
    /**
     * name:domains, type:hash
     */
    public final String REDIS_DOMAINS = "domains";
    /**
     * name:ips, type:zset
     */
    public final String REDIS_IPS = "ips";

    /**
     * 
     * @param key
     * @param min
     * @param max
     * @return ResultEntry的getReturnVal()即真是统计值
     */
    public ResultDto count(String key, Double min, Double max);

    /**
     * 数据同步(map类型, 覆盖式)
     * 
     * @param key
     * @param hash
     * @return Return OK or Exception if hash is empty
     */
    public ResultDto addHash(String key, Map<String, String> hash);

    /**
     * 数据同步(zset类型)
     * 
     * @param key
     * @param hash
     *            Integer reply, specifically: 1 if the new element was added 0 if the element was already a member of the sorted set and the score was updated
     */
    public ResultDto addZSet(String key, Map<String, Double> hash);

    /**
     * 
     * @param key
     * @return Time complexity: O(1)
     */
    public ResultDto del(String key);

}
